﻿using System;
using System.IO;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal struct FrtRefHeader
    {
        internal Ref8 ref8 ;
        public ushort rt;
        internal FrtFlags grbitFrt;

        public FrtRefHeader(ushort i)
        {
            rt = i;
            ref8 = new Ref8();
            grbitFrt = 0;
        }

        internal const int Size = 12;

        public void Read(BinaryReader reader)
        {
            this.rt = reader.ReadUInt16();
            this.grbitFrt = (FrtFlags)reader.ReadUInt16();
            this.ref8.Read(reader);
        }

        public void Write(BinaryWriter writer)
        {
            writer.Write(rt);
            writer.Write((ushort)grbitFrt);
            this.ref8.Write(writer);
        }
    }
}